<%--
  Created by IntelliJ IDEA.
  User: songyahui
  Date: 2019/9/21
  Time: 15:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>发布活动 - 活动问题解答 - 活动问题交流 - freedom</title>
    <meta name="keywords" content="旅行问题,逍遥问答">
    <meta name="description" content="">
    <meta name="google-site-verification" content="DVVM1p1HEm8vE1wVOQ9UjcKP--pNAsg_pleTU5TkFaM">
    <link rel="icon" href="${pageContext.request.contextPath}/images/logo_c.ico">


    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/activity_release.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/modules/layer/default/layer.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/dist/css/bootstrap.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/dist/css/bootstrap-theme.css">
    <script src="${pageContext.request.contextPath}/layui/lay/modules/layer.js" charset="utf-8"></script>
    <script src="${pageContext.request.contextPath}/layui/layui.js" charset="utf-8"></script>
    <script src="${pageContext.request.contextPath}/js/activity_release.js"></script>
    <script src="${pageContext.request.contextPath}/js/jquery-3.4.1.min.js"></script>
    <script src="${pageContext.request.contextPath}/dist/js/bootstrap.js"></script>
    <script src="${pageContext.request.contextPath}/js/question_details.js"></script>

    <script type="text/javascript" charset="utf-8" src="${pageContext.request.contextPath}/utf8-jsp/lang/zh-cn/zh-cn.js"></script>
    <script src="${pageContext.request.contextPath}/js/qiniuone.js"></script>
    <script src="${pageContext.request.contextPath}/js/qiniutwo.js"></script>

    <%--<script src="${pageContext.request.contextPath}/js/jquery-3.4.1.js"></script>--%>

    <style type="text/css">
        .tabs-container{
            width:650px;
            padding: 10px;
        }
        .tabs{
            display: table-cell;
            width: 10000px;
        }
        .tab{
            display: inline-block;
            border: 1px solid #c5c5c5;
            border-radius: 2px;
            height: 30px;
            margin-bottom: 14px;
            margin-right: 12px;
            padding: 0px 10px;
        }
        .tab .tab-show{
            margin-right: 5px;
        }
        .tab .tab-text{
            border: none;
            display: none;
            outline: none;
        }
        .tab .tab-edit{
            cursor: pointer;
            color:gray;
        }
        /*这是利用after后面加content*/
        /*.tab .tab-edit::after{
            content: "\270f";
        }*/
        /*这是设置一个背景图片*/
        .tab .tab-edit{
            /*margin-top: 3px;*/
            margin-left: 2px;
            cursor: pointer;
            width: 21px;
            height: 21px;
            display: inline-block;
            background: url(${pageContext.request.contextPath}/images/edit_lable_c.png) no-repeat left 5px;
            background-position: 0px 6px;
        }
        .tab .tab-delete{
            cursor: pointer;
            width: 21px;
            height: 21px;
            display: inline-block;
            background: url(${pageContext.request.contextPath}/images/delete_lable_c.png) no-repeat left 5px;
            background-position: 0px 6px;
        }

        .tab.active .tab-show{
            display: none;
        }
        .tab.active .tab-text{
            display: inline-block;
            font-size: 16px;
            width: 130px;
        }
        /*这是利用after后面加content*/
        /*.tab.active .tab-edit::after{
            content:"\2713";
        }*/
        /*这是设置一个背景图片*/
        .tab.active .tab-edit{
            color:blue;
            background: url(${pageContext.request.contextPath}/images/sure_lable_c.png) no-repeat left 5px;
            width: 21px;
            height: 21px;
            display: inline-block;
        }

        .tab.active .tab-delete{
            color: #666;
            display: none;
        }
        .tab.active .tab-delete:hover{
            color: #999;
        }
        .tab.active .tab-delete:active{
            color: #333;
        }
        .tabs .tab-add{
            width: 21px;
            height: 21px;
            cursor: pointer;
            display: inline-block;
            background: url(${pageContext.request.contextPath}/images/add_lable_c.png) no-repeat  center;
            background-position: 0px 2px;
        }
        #btn{
            margin-top: 10px;
        }
    </style>
</head>
<body>
<%--导航--%>
<c:choose>
    <c:when test="${memberall.userId != 0}">
        <c:if test="${memberall.userStatus == 0}">
            <img src="http://localhost:8080/mydev/images/vip.png" style="position:absolute;top:23px;right: 345px;z-index: 999;">
        </c:if>
        <c:if test="${memberall.userStatus == 1}">
            <a href="http://localhost:8080/mydev/VIP" style="position:absolute;top:13px;right: 400px;z-index: 999;">开通vip</a>
        </c:if>
    </c:when>
</c:choose>
<div class="header-container" style="width: 100%; min-width: 1500px;  ">

    <div class="row first-div" style="z-index: 999; width: 100%">
        <div class=" left-nav-ul" >
        </div>


        <ul class="mid-nav-ul" >
            <li class="nav-ul-li" >
                <a   style="text-decoration: none" href="http://localhost:8080/mydev/start/index">
                    <div>
                        <img src="http://localhost:8080/mydev/images/logo.png">
                        逍遥游
                    </div>
                </a>

            </li>
            <li class="nav-ul-li" style="background-color: #ff9d00">
                <a style="text-decoration: none;color: #ffffff" href="http://localhost:8080/mydev/start/index">首页</a>
            </li>
            <li class="nav-ul-li">
                <a  style="text-decoration: none" href="http://localhost:8080/mydev/QuestionTable/club_questions">问答</a>
            </li>

            <li class="nav-ul-li">
                <a   style="text-decoration: none" href="http://localhost:8080/mydev/clublist/list">鲲鹏俱乐部</a>
            </li>

            <li class="nav-ul-li new">
                <div class="geren">
                    <a  style="text-decoration: none; color:black" href="">更多</a>
                    <div class="t1"></div>
                </div>
                <div class="hidden1">
                    <ul class="geren-ul">
                        <li>
                            <a  style="text-decoration: none" href="http://localhost:8080/mydev/write/travel">写游记</a>
                        </li>
                        <li>
                            <a  style="text-decoration: none"  href="http://localhost:8080/mydev/myhome/mytravel/${memberall.userId}">我的游记</a>
                        </li>
                    </ul>
                </div>
            </li>

            <li class="nav-ul-li" >
                <c:choose>
                    <c:when test="${memberall.userId != 0}">
                        <c:if test="${memberall.userStatus ==0}">
                             <span  style="color: gold">
                                 欢迎!${memberall.userName}
                             </span>
                        </c:if>
                        <c:if test="${memberall.userStatus ==1}">
                             <span  style="color: black">
                                 欢迎!${memberall.userName}
                             </span>
                        </c:if>


                    </c:when>
                    <c:otherwise>
                        <a  style="text-decoration: none" href="http://localhost:8080/mydev/regist/normalRegist">注册</a>
                    </c:otherwise>
                </c:choose>

            </li>
            <li class="nav-ul-li">
                <c:choose>
                    <c:when test="${memberall.userId != 0}">

                    </c:when>
                    <c:otherwise>
                        <a  style="text-decoration: none" href="http://localhost:8080/mydev/login/login">登陆</a>
                    </c:otherwise>
                </c:choose>


            </li>
        </ul>




        <c:choose>
            <c:when test="${memberall.userId != 0}">

                <div class="right-nav-ul" >
                    <div class="topmaguser" style="  position:relative;left: 0px;top:2px">


                        <a href="http://localhost:8080/mydev/myhome/mytravel/${memberall.userId}" >
                            <img src="http://localhost:8080/mydev/${memberall.userPicture}">
                        </a>

                    </div>
                    <ul class="right-mid" >
                        <li class="nav-ul-li new" >

                            <div class="geren">

                                <a style="text-decoration: none; color:black" href="">个人中心</a>

                                <div class="t2"></div>
                            </div>

                            <div class="hidden1">
                                <ul class="gere-ul">

                                    <li style="height: 45px;">
                                        <a  style="text-decoration: none" href="http://localhost:8080/mydev/myfoot/collect/${memberall.userId}"><img src="http://localhost:8080/mydev/images/savea.png">我的收藏</a>
                                    </li>
                                    <li style="height: 45px;">
                                        <a  style="text-decoration: none" href="http://localhost:8080/mydev/myfoot/mapview/${memberall.userId}"><img src="http://localhost:8080/mydev/images/foot.png">我的足迹</a>
                                    </li>
                                    <li style="height: 45px;">
                                        <a  style="text-decoration: none" href="http://localhost:8080/mydev/myfoot/answer/${memberall.userId}"><img src="http://localhost:8080/mydev/images/question.png">我的问答</a>
                                    </li>
                                    <li style="height: 45px;">
                                        <a  style="text-decoration: none" href="http://localhost:8080/mydev/reply/toaccount/${memberall.userId}"><img src="http://localhost:8080/mydev/images/question.png">回复消息</a>
                                    </li>

                                    <li style="height: 45px;">
                                        <a  style="text-decoration: none" href="http://localhost:8080/mydev/exit"><img src="http://localhost:8080/mydev/images/banka.png">退出登录</a>
                                    </li>
                                </ul>
                            </div>
                        </li>
                    </ul>
                </div>
            </c:when>
            <c:otherwise>



            </c:otherwise>
        </c:choose>

    </div>
</div>
<%--主体--%>
<div class="ask_wp" style="width: 1000px;margin:20px auto">
    <!--==================================旅行问答 > 活动  ==================================-->
    <div class="ask_sub_nav"><a href="/">鲲鹏俱乐部</a> <span></span>发布活动</div>
    <!--  ====================================body主体===================================== -->
    <!--左边-->
    <div style="width: 675px;margin-bottom: 30px;float: left">
        <div class="ask_item mt10" style="position: relative;">

            <form id="js_add_question" _action="/question.php?action=doadd&amp;id=" method="post" style="">

                <!--你的活动主题-->
                <div class="text-activity" style="margin-top: 30px">
                    <span><strong style="font-size: 20px;color: #636363">一句话描述你的活动</strong></span>
                    <div style="margin-top:5px;width:650px;height:40px;background-color: white;border:1px solid #ff8a00;border-radius: 3px ">
                        <input type="text" style="border:none;margin-left:5px;margin-top:2.5px ;width:640px;height: 35px;border: none " placeholder="标题不能超过30个字" class="clubName"/>
                        <div style="float:right;margin-top: 5px">
                            <span>0</span>/30
                        </div>
                    </div>
                </div>
                <!--日期时间设置-->
                <div class="time-setting" style="margin-top: 50px;">

                    <div class="layui-form">
                        <div class="layui-form-item">
                            <div class="layui-inline" style="margin-left: -10px">
                                <label class="layui-form-label"style="width: 100px;">报名时间</label>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input" id="test6" placeholder="yyyy-MM-dd ">
                                </div>
                            </div>
                            <br>

                            <div class="layui-inline" style="margin-left: -10px">
                                <label class="layui-form-label" style="width: 100px;">活动时间</label>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input" id="test8" placeholder="yyyy-MM-dd">
                                </div>
                            </div>


                        </div>
                    </div>



                    <script>
                        layui.use('laydate', function() {
                            var laydate = layui.laydate;

                            //报名时间范围
                            laydate.render({
                                elem: '#test6'
                                , range: true
                                ,theme:'#ffa800'
                                ,min:0
                                ,max:60
                            });

                            //活动时间范围
                            laydate.render({
                                elem: '#test8'
                                , range: true
                                ,theme:'#ffa800'
                                ,min:0
                                ,max:60
                            });
                        });



                    </script>
                </div>

                <!--活动地点-->
                <div class="layui-form-item">
                    <div class="layui-inline" style="margin-left: -10px">
                        <label class="layui-form-label" style="width: 100px;">活动地点</label>
                        <div class="layui-input-inline" style="width: 100px;">
                            <input  type="text" name="location_min" placeholder="地点" autocomplete="off" class="layui-input" id="clubLocation">
                        </div>
                    </div>
                </div>
                <!--发布费用-->
                <div class="layui-form-item">
                    <div class="layui-inline" style="margin-left: -10px">
                        <label class="layui-form-label" style="width: 100px;">参加费用</label>
                        <div class="layui-input-inline" style="width: 100px;">
                            <input  type="text" name="price_min" placeholder="￥" autocomplete="off" class="layui-input" id="clubPrice">
                        </div>
                    </div>
                </div>
                <!--文本域-->
                <div class="text-area">
                    <div style="margin-top:50px;">
                        <span><strong style="font-size: 20px;color: #636363">详细内容补充</strong></span>
                    </div>
                    <div style="margin-top:5px;width: 650px;height: 300px;border: 1px solid #ff8a00;border-radius: 5px">
                        <textarea type="text" name="content" id="ueditor_textarea_content" style="overflow-y:hidden;width: 640px;height: 290px;margin-left: 5px;margin-top: 5px;resize: none;border: none"></textarea>
                        <div style="float:right;margin-top: 3px">
                            <%--<span>0</span>/1000--%>
                        </div>
                    </div>
                </div>



                <!--上传图片-->
                <%--  <button style=" position:absolute; top:750px;left:10px;height: 38px;width: 115px;background-color: #ff9d00" class="layui-btn">
                  <i class="layui-icon">&#xe67c;</i>上传图片</button>

                  <form method="post" enctype="multipart/form-data" id="imgform" style="color:black;position:absolute; top:570px;left:30px;height: 38px;opacity:0.5">
                      <input type="file" name="myfile" id="myfile"  style="color:black;height: 38px;width: 115px;opacity:0.5;position:absolute;top:750px;left:10px;">
                  </form>
                  <script>
                      $("#myfile").change(function () {
                          $("#imgform").ajaxSubmit({
                              url:"${pageContext.request.contextPath}/test/upload",
                              method:"POST",
                              dataType:"json",
                              success:function (data) {
                                  console.log(data.imgUrl);
                                  var ele ="<img>"
                                  // $("#travelpic").empty();
                                  $("#travelpic").append(ele);
                                  $("#travelpic").find("img").attr("src",data.imgUrl);
                              }
                              ,error:function (data) {
                                  alert(data)
                              }
                          })
                      })
                  </script>--%>





                <%--<div style="margin-top: 50px;height: 20px">--%>
                <%--<button type="button" class="layui-btn" id="test1" style="background-color: #ff9d00">--%>
                <%--<i class="layui-icon">&#xe67c;</i>上传图片--%>
                <%--</button>--%>
                <%--<script src="/static/build/layui.js"></script>--%>
                <%--<script>--%>
                <%--layui.use('upload', function(){--%>
                <%--var upload = layui.upload;--%>

                <%--//执行实例--%>
                <%--var uploadInst = upload.render({--%>
                <%--elem: '#test1' //绑定元素--%>
                <%--,url: '/upload/' //上传接口--%>
                <%--,done: function(res){--%>
                <%--//上传完毕回调--%>
                <%--}--%>
                <%--,error: function(){--%>
                <%--//请求异常回调--%>
                <%--}--%>
                <%--});--%>
                <%--});--%>
                <%--</script>--%>
                <%--</div>--%>



                <!--提交 .layui-layer-btn .layui-layer-btn0 -->
                <div class="site-demo-button"  style="float:right;margin-left: 30px;margin-top: 50px">
                    <button data-method="notice" class="layui-btn" type="button" id="layerDemo"style="background-color: #ff9d00"onclick = "checkSubmit()">发布活动</button>

                </div>



                <%--<script>--%>
                <%--layui.use('layer', function(){ //独立版的layer无需执行这一句--%>
                <%--var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句--%>
                <%--//触发事件--%>
                <%--var active = {--%>
                <%--notice: function(){--%>
                <%--//示范一个公告层--%>
                <%--layer.open({--%>
                <%--type: 1--%>
                <%--,title: false //不显示标题栏--%>
                <%--,closeBtn: false--%>
                <%--,area: '300px;'--%>
                <%--,shade: 0.8--%>
                <%--,id: 'LAY_layuipro' //设定一个id，防止重复弹出--%>
                <%--,btn: ['确定' , '手滑了']--%>
                <%--,btnAlign: 'c'--%>
                <%--,moveType: 1 //拖拽模式，0或者1--%>
                <%--,content: '<div style="padding: 50px; line-height: 22px; background-color: #ff9d00; color: #fff; font-weight: 300;">亲，是否提交</div>'--%>
                <%--,success: function(layero){--%>
                <%--var btn = layero.find('.layui-layer-btn');--%>
                <%--btn.find('.layui-layer-btn0').attr({--%>
                <%--href: 'http://www.layui.com/'--%>
                <%--,target: '_blank'--%>
                <%--});--%>
                <%--}--%>
                <%--});--%>
                <%--}--%>
                <%--};--%>
                <%--$('.layui-btn').on('click', function(){--%>
                <%--var othis = $(this), method = othis.data('method');--%>
                <%--active[method] ? active[method].call(this, othis) : '';--%>
                <%--});--%>
                <%--});--%>
                <%--</script>--%>
            </form>
        </div>
    </div>
    <!--右边-->
    <div style="width: 300px;float: left">
        <div style="height: 400px;width: 300px">
        </div>
        <div class="ask_tips_right" style="">
            <span class="square"></span>
            <div style="margin-left: 15px">
                <h3>如何发布一个优质的活动？</h3>
                <ul>
                    <li><span>1.</span><span>【标题】直接列出重要信息比“好玩”和“有趣”更有用嗷</span></li>
                    <li><span>2.</span><span>【补充描述】越详细具体，越有助于大家参加活动</span></li>
                    <li><span>3.</span><span>【日期】报名结束时间一定要在活动开始之前嗷</span></li>
                    <li><span>4.</span><span>【费用】要考虑参加人群，费用设置要合理</span></li>
                </ul>
            </div>

        </div>
    </div>

    <div id="acttippic" class="acttippic" >

    </div>
    <button style=" position:absolute; top:920px;left:280px;height: 38px;width: 115px;background-color: #ff9d00" class="layui-btn">
        <i class="layui-icon">&#xe67c;</i>上传图片</button>
    <form method="post" enctype="multipart/form-data" id="imgform" style=" position:absolute; top:920px;left:280px;height: 38px;opacity: 0">
        <input type="file" name="myfile" id="myfile" style="height: 38px;width: 115px">
    </form>
    <script>
        $("#myfile").change(function () {
            $("#imgform").ajaxSubmit({
                url:"${pageContext.request.contextPath}/test/upload",
                method:"POST",
                dataType:"json",
                success:function (data) {
                    console.log(data.imgUrl);
                    var ele ="<img>"
                    $("#acttippic").empty();
                    $("#acttippic").append(ele);
                    $("#acttippic").find("img").attr("src",data.imgUrl);
                }
                ,error:function (data) {
                    alert(data)
                }
            })
        })
    </script>

</div>
<%--底部--%>
<!--底部-->
<div class="buttom">
    <div class="col-md-2 "></div>
    <div class="col-md-2 left-buttom">
        <p style="font-size: 15px">逍遥游攻略网</p>
        <p>年轻人更爱用的攻略</p>
        <p>逍遥游攻略网</p>
        <p>无数旅行者共同打造的"旅行神器"</p>
        <p>  60,000 多个全球旅游目的地 </p>
        <p>  600,000 个细分目的地新玩法</p>
        <p>  760,000,000 次攻略下载</p>
    </div>
    <div class="col-md-2 mid-buttom">
        <p style="font-size: 15px">关于我们</p>
        <a href="">关于逍遥游</a> &nbsp <a href="">联系我们</a> </br>
        <a href="">隐私政策</a> &nbsp <a href="">商标声明</a> </br>
        <a href="">服务协议</a> &nbsp <a href="">游记协议</a> </br>
        <a href="">商城平台服务协议</a> </br>
        <a href="">网络信息侵权通知引导</a><br>
        <a href="">旅游网服务监督员</a>



    </div>
    <div class="col-md-2 right-buttom">
        <p  style="font-size: 15px">旅行服务</p>
        <a href="">旅游攻略</a> &nbsp <a href="">酒店预订</a> </br>
        <a href="">旅游特价</a> &nbsp <a href="">国际租车</a> </br>
        <a href="">旅游问答</a> &nbsp <a href="">旅游保险</a> </br>
        <a href="">旅游指南</a> &nbsp <a href="">订火车票</a> </br>
        <a href="">旅游资讯</a> &nbsp <a href="">APP下载</a> </br>

    </div>

    <div class="col-md-1 link-buttom">
        <img src="${pageContext.request.contextPath}/images/erweima1B.png"></br>
        <p>app下载</p>
    </div>
    <div class="col-md-1 link-buttom">
        <img src="${pageContext.request.contextPath}/images/erweima2B.png">
        <p>公众号</p>
    </div>
    <div class="col-md-1 link-buttom">
        <img src="${pageContext.request.contextPath}/images/erweima3B.png">
        <p>订阅号</p>
    </div>


</div>
<div class="dixian">我们是有底线的</div>

<script>
    //防止表单重复提交
    function checkSubmit(){
        document.getElementById("layerDemo").disabled = "disabled";
        return true;
    }
</script>
<script>
    $('.layui-btn').click(function() {
        var clubName=$(".clubName").val(); //活动名
        var clubLocation=$("#clubLocation").val(); //活动地点
        var clubTheme=$("#ueditor_textarea_content").val(); //活动详情
        var clubPrice=$("#clubPrice").val();//活动费用
        var clubBaoming=$("#test6").val();//报名时间
        var  clubHuodong=$("#test8").val(); //活动时间
        var img = $("#acttippic img").attr('src');//获取头图路径

        console.log(clubName);
        console.log(clubLocation);
        console.log(clubPrice);
        console.log(clubTheme);
        console.log(clubBaoming);
        console.log(clubHuodong);
        console.log(img);

        $.ajax({
            type:"POST",
            data:{
                "clubName":clubName,
                "clubLocation":clubLocation,
                "clubTheme":clubTheme,
                "clubPrice":clubPrice,
                "clubBaoming":clubBaoming,
                "clubHuodong":clubHuodong,
                "img":img
            },
            url:"${pageContext.request.contextPath}/write/activivity",
            success:function (result) {
                console.log(result);
                window.location.href="${pageContext.request.contextPath}/clublist/list"

            }

        })
    });
</script>

</body>
</html>
